package com.ruoyi.common.utils;

import java.io.File;
import java.io.IOException;

import org.deeplearning4j.models.embeddings.loader.WordVectorSerializer;
import org.deeplearning4j.models.word2vec.Word2Vec;

public class Word2VecUtil {
	private static Word2Vec word2vec;
	public static void initWord2Vec(String path) {
		File file = new File(path);
		try {
			word2vec =WordVectorSerializer.readWord2Vec(file);
			System.out.println("Load Word2Vec Model Success");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			System.out.println("Load Word2Vec Model Fail");
			e.printStackTrace();
		}
	}
	public static Word2Vec getWord2Vec() {
		return word2vec;
	}
}
